import bus from "@/bus";
import { Poptip, Icon } from 'view-design';
import { formatDate } from '@/util'

let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    companyname: '',
    name: '',
    erpsn: '',
    telphone: '',
    brandId: '',
    userType: '',
    auditStatus: null,
    month: formatDate(new Date())
  },
  columns: [{
    title: '经销商名称',
    key: 'distributorName',
    align: 'left',
    minWidth: 200
  }, {
    title: '联系人',
    key: 'distributorContact',
    align: 'left',
    minWidth: 150
  }, {
    title: '所属区域',
    key: 'areaName',
    align: 'left',
    minWidth: 200
  }, {
    title: '待审核积分',
    key: 'applyIntegral',
    align: 'right',
    minWidth: 120,
    renderHeader: (h, params) => {
      return <Poptip trigger="hover" transfer width="200" word-wrap content="该经销商待审核的进货积分">
                  <span>待审核积分</span>
                  <Icon type="ios-help-circle" />
              </Poptip>
      }
  }, {
    title: '审定积分',
    key: 'auditedIntegral',
    align: 'right',
    minWidth: 100
  }, {
    title: '审核状态',
    key: 'auditStatus',
    align: 'left',
    minWidth: 100,
    render: (h, param) => {
      let text = param.row.auditStatus ? '已审核' : '待审核'
      return h('span', text)
    }
  }, {
    title: '审核人',
    key: 'auditor',
    align: 'left',
    minWidth: 150
  }, {
    title: '审核时间',
    key: 'auditDate',
    align: 'left',
    minWidth: 150
  }, {
    title: '操作',
    align: 'right',
    minWidth: 150,
    fixed: 'right',
    render: (h, params) => {
      return h('div', [
        h("Button", {
          props: {
            size: "small"
          },
          class: 'mr',
          on: {
            click: () => {
              bus.$emit("infoRow", params.row)
            }
          }
        }, '查看'),
        h("Button", {
          props: {
            size: "small",
            type: 'primary'
          },
          style: {
            marginRight: "5px"
          },
          on: {
            click:() => {
              bus.$emit("checklRow", params.row)
            }
          }
        }, '审核'),
      ])
    }
  }],
  data: [{}]
}
export default data;
